home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_1.3 / Read-Me1.3 / Printer1.3 / Driver.Examples / src / epsonQ / density.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-08-01  |  797 b   |  28 lines

  1. /*
  2.     Density module for EpsonQ driver.
  3.     David Berezowski - October/87
  4. */
  5.  
  6. #include <exec/types.h>
  7. #include "../printer/printer.h"
  8. #include "../printer/prtbase.h"
  9.  
  10. SetDensity(density_code)
  11. ULONG density_code;
  12. {
  13.     extern struct PrinterData *PD;
  14.     extern struct PrinterExtendedData *PED;
  15.  
  16.     /* SPECIAL_DENSITY     0   1   2    3    4    5    6    7 */
  17.     static int XDPI[8] = {90, 90, 120, 180, 360, 360, 360, 360};
  18.     static char codes[8] = {38, 38, 33, 39, 40, 40, 40, 40};
  19.  
  20.     PED->ped_MaxColumns = 
  21.         PD->pd_Preferences.PaperSize == W_TRACTOR ? 136 : 80;
  22.     density_code /= SPECIAL_DENSITY1;
  23.     /* default is 80 chars (8.0 in.), W_TRACTOR is 136 chars (13.6 in.) */
  24.     PED->ped_MaxXDots = (XDPI[density_code] * PED->ped_MaxColumns) / 10;
  25.     PED->ped_XDotsInch = XDPI[density_code];
  26.     return(codes[density_code]);
  27. }
  28.